#include "bit_util.h"

#include <stdio.h>
#include <stdint.h>

int main(int argc, char *argv[])
{
    uint8_t data = 0x00;

    printf("origin data = %02X\n", data);
    printf("BIT_SET(data, 3): 0x%02X\n", BIT_SET(data, 3));
    printf("BIT_SET(data, 7): 0x%02X\n", BIT_SET(data, 7));

    printf("BIT_GET(data, 7): 0x%02X\n", BIT_GET(data, 7));
    printf("BIT_GET(data, 6): 0x%02X\n", BIT_GET(data, 6));

    printf("BIT_CLR(data, 3): 0x%02X\n", BIT_CLR(data, 3));
    printf("BIT_CLR(data, 7): 0x%02X\n", BIT_CLR(data, 7));

    printf("BITS_SET(data, 2, 5): 0x%02X\n", BITS_SET(data, 2, 5));
    printf("BITS_GET(data, 2, 3): %d\n", BITS_GET(data, 2, 3));
    printf("BITS_CLR(data, 2, 3): 0x%02X\n", BITS_CLR(data, 2, 3));
    BITS_SET_VAL(data, 0, 3, 10);
    printf("BITS_SET_VAL(data, 0, 3, 10): 0x%02X\n", data);

    printf("BITS_MASK(11): 0x%02X\n", BITS_MASK(11));
    printf("BITS_MASK_GIVEN(4, 11): 0x%02X\n", BITS_MASK_GIVEN(4, 11));

    return 0;
}
